package cn.jly.spring.jdbc.service;

import cn.jly.spring.jdbc.bean.Student;
import cn.jly.spring.jdbc.dao.StudentDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lanyangji
 * @description
 * @date 2020/11/11 上午 10:55
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDao studentDao;

    @Override
    public int[] batchUpdate(List<Student> students) {
        return studentDao.batchUpdate(students);
    }

    @Override
    public int[] batchDelete(List<Integer> ids) {
        return studentDao.batchDelete(ids);
    }

    @Override
    public int[] batchInsert(List<Student> students) {
        return studentDao.batchInsert(students);
    }

    @Override
    public List<Student> getAll() {
        return studentDao.getAll();
    }

    @Override
    public Student getById(Integer id) {
        return studentDao.getById(id);
    }

    @Override
    public int insert(Student student) {
        return studentDao.insert(student);
    }

    @Override
    public int deleteById(Integer id) {
        return studentDao.deleteById(id);
    }

    @Override
    public int updateById(Student student) {
        return studentDao.updateById(student);
    }
}
